﻿using System;
using System.Diagnostics;

namespace Utility.Threading
{
    public static class Profiler
    {
        private static long pStart;
        private static long pEnd;
        private static string pLabel;

        public static void Start(string label)
        {
            pStart = DateTime.Now.Ticks;
            pLabel = label;
        }

        public static void Stop()
        {
            pEnd = DateTime.Now.Ticks;
            long t = (pEnd - pStart);
            if (t > 0)
            {
                Debug.WriteLine("Label " + pLabel + " cost " + t + " ticks.");
            }
        }
    }
}
